// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdSession
 */
public class AdSessionDaoImpl
    extends org.tinaelle.server.domain.AdSessionDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdSessionDao#toAdSessionDTO(org.tinaelle.server.domain.AdSession)
     */
    public org.tinaelle.common.dto.AdSessionDTO toAdSessionDTO(final org.tinaelle.server.domain.AdSession entity)
    {
        return super.toAdSessionDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdSession loadAdSessionFromAdSessionDTO(org.tinaelle.common.dto.AdSessionDTO adSessionDTO)
    {
        org.tinaelle.server.domain.AdSession adSession = this.load(adSessionDTO.getAdSessionId());
        if (adSession == null)
        {
            adSession = org.tinaelle.server.domain.AdSession.Factory.newInstance();
        }
        return adSession;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdSessionDao#adSessionDTOToEntity(org.tinaelle.common.dto.AdSessionDTO)
     */
    public org.tinaelle.server.domain.AdSession adSessionDTOToEntity(org.tinaelle.common.dto.AdSessionDTO adSessionDTO)
    {
        org.tinaelle.server.domain.AdSession entity = this.loadAdSessionFromAdSessionDTO(adSessionDTO);
        this.adSessionDTOToEntity(adSessionDTO, entity, true);
        return entity;
    }
}